package com.ruoyi.socketServer;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

// springboot 集成启动 netty server，同时不影响tomcat接口
@Component
public class NeetyBoot implements CommandLineRunner {

    @Autowired
    private NeetyServer neetyServer;

    @Override
    public void run(String... args) throws Exception {
        try{
            //启动服务
            neetyServer.start();
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
